//part1:C04:ex4.21.cpp -- find the odd numer.
#include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>

int main(void)
{
    using namespace std;
    vector<int> vInt;
    const int sz = 10;
    srand((unsigned)time(NULL));
    cout << "array is :\n";
    for (int i = 0; i != sz; ++i)
    {
        vInt.push_back(rand() % 100);    
        cout << vInt[i] << " ";
    }
    cout << endl;
    for (auto &val : vInt)
    {
        val = (val % 2 != 0) ? val * 2 : val;    
    }
    cout << "after array is:\n";
    for (auto it = vInt.cbegin();  it != vInt.cend(); ++it) 
    {
        cout << *it << " ";    
    }
    cout << endl;

    return 0;
}

